package com.yunxi.service.dubboService.impl.vip;

import com.github.pagehelper.PageInfo;
import com.yunxi.model.vip.VipApplyDetail;
import com.yunxi.service.localService.vip.VipApplyDetailService;
import com.yunxi.vip.pojo.VipApplyDetailVO;
import com.yunxi.vip.service.VipApplyDetailDubboService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

import java.lang.reflect.InvocationTargetException;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 
 * @since 2019-09-06
 */
public class VipApplyDetailDubboServiceImpl implements VipApplyDetailDubboService {

    @Autowired
    @Qualifier(value = "vipApplyDetailServiceImpl")
    VipApplyDetailService vipApplyDetailService;


    @Override
    public VipApplyDetailVO getById(String id) throws InvocationTargetException, IllegalAccessException {
    VipApplyDetail vipApplyDetail = vipApplyDetailService.getById(id);
    VipApplyDetailVO vipApplyDetailVO = new VipApplyDetailVO();
        BeanUtils.copyProperties(vipApplyDetail,vipApplyDetailVO);
        return vipApplyDetailVO;
    }

    @Override
    public void saveOrUpdate(VipApplyDetailVO vipApplyDetailVO) throws InvocationTargetException, IllegalAccessException {
    VipApplyDetail vipApplyDetail = new VipApplyDetail();
        BeanUtils.copyProperties(vipApplyDetailVO,vipApplyDetail);
    vipApplyDetailService.saveOrUpdate(vipApplyDetail);
    }

    @Override
    public void removeById(String id) {
    vipApplyDetailService.removeById(id);
    }

    @Override
    public PageInfo<VipApplyDetailVO> findPageByVO(VipApplyDetailVO vipApplyDetailVO, Integer pageNum, Integer pageSize) throws InvocationTargetException, IllegalAccessException {
      PageInfo<VipApplyDetailVO> pageInfo = vipApplyDetailService.pageByVo(vipApplyDetailVO,pageNum,pageSize);
      return pageInfo;
   }

    @Override
    public void removeByListVo(List<VipApplyDetailVO> vipApplyDetailVOList) throws IllegalAccessException, InvocationTargetException, InstantiationException {
        vipApplyDetailService.removeByListVo(vipApplyDetailVOList);
    }

    @Override
    public List listByVo(VipApplyDetailVO vipApplyDetailVO) {
      return vipApplyDetailService.listByVo(vipApplyDetailVO);
    }
}
